﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="SceneList.aspx.vb" Inherits="helzwebscripting.SceneList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>Your Twilight Saga Scenes</h1>

    <asp:HyperLink runat="server" ID="RSSbtn" NavigateUrl="~/RssFeedScenes.aspx" >
    <asp:Image class="floatRight" runat="server" ImageUrl="~/Pictures/Design/rss_btn.png" AlternateText="RSS" />
    </asp:HyperLink>
    <br />
    <p>Twilighters, here are your scenes. Simply click the image for details.<br />
        Whether a scene makes you swoon, laugh or cry, add yours today!</p>
    <asp:Button ID="addNewScene" runat="server" Text="Add Your Scene Here" CssClass="addBtn" />
    <br /><br />
 <asp:GridView ID="GridView1" class="gridviewList" runat="server" AutoGenerateColumns="False"  DataKeyNames="ID" DataSourceID="ScenesDB" AllowSorting="True"
       CellPadding="1" GridLines="None" AllowPaging="true" PagerStyle-CssClass="pager" AlternatingRowStyle-CssClass="altRowStyle" PageSize="4">
        <Columns>
        <asp:TemplateField HeaderText="Scene Name" SortExpression="SceneName">
                <ItemTemplate>
                <div style="max-width:300px;word-wrap:break-word;">
                <%# Eval("SceneName")%>
                </div>
                </ItemTemplate>
                </asp:TemplateField>
            <asp:TemplateField HeaderText="Image">
                <ItemTemplate>
                    <div class="thumbContainer">
                    <asp:HyperLink ID="imgDetailLink" runat="server" NavigateUrl='<%# Eval("ID", "SceneDetails.aspx?ID={0}") %>'>
                    <asp:Image id="sceneImg" runat="server" ImageUrl='<%# Eval("SceneImg")%>' CssClass="thumbnail" />
                    </asp:HyperLink>
                    </div>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="TwiWriter" SortExpression="TwiWriter">
                <ItemTemplate>
                <div style="max-width:300px;word-wrap:break-word;">
                <%# Eval("TwiWriter")%>
                </div>
                </ItemTemplate>
                </asp:TemplateField>
            <asp:BoundField DataField="DateUploaded" HeaderText="Date Uploaded" SortExpression="DateUploaded" />
        </Columns>
        <HeaderStyle ForeColor="Black" />
        <SortedAscendingHeaderStyle ForeColor="Black"/>
        <SortedDescendingHeaderStyle ForeColor="Black"/>
    </asp:GridView>
<%--    To style above gridview header sorting links in a colour other than blue: msdn.microsoft.com/en-us/library/dd695835%28v=vs.100%29.aspx--%>
    <asp:SqlDataSource ID="ScenesDB" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TwilightConn %>" 
        ProviderName="<%$ ConnectionStrings:TwilightConn.ProviderName %>" 
        SelectCommand="SELECT * FROM [SceneList] ORDER BY DateUploaded ASC"></asp:SqlDataSource>
    <br />
    <br />
    <br />
</asp:Content>
